#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable : 4996)
#pragma warning(disable : 6031)

#include "slist.h"

test1()
{
	SListNode SL = { 0 };
	SListNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SListPopBack(&plist);
	SListPrint(plist);
	printf("\n");

	SListPopBack(&plist);
	SListPrint(plist);
	printf("\n");

	SListPopBack(&plist);
	SListPrint(plist);
	printf("\n");

	SListPopBack(&plist);
	SListPrint(plist);
	printf("\n");

}

test2()
{
	SListNode SL = { 0 };
	SListNode* plist = NULL;
	SListPushFront(&plist, 1);
	SListPushFront(&plist, 2);
	SListPushFront(&plist, 3);
	SListPushFront(&plist, 4);
	SListPrint(plist);
	printf("\n");

	SListNode* pf = SListFind(plist , 2);
	pf->data = 20;
	SListPrint(plist);
	printf("\n");

	pf = SListFind(plist, 3);
	SListInsertAfter(pf, 30);
	SListPrint(plist);
	printf("\n");

	pf = SListFind(plist, 4);
	SListEraseAfter(pf);
	SListPrint(plist);
	printf("\n");

	SListDestroy(plist);
}

int main()
{
	test1();
	//test2();
	return 0;
}